import React, { Component } from 'react'
import axios from 'axios'

export default class Request extends Component {

  handleRequest = () => {
    axios.get('/api/students').then(res => {
      console.log(res)
    }).catch(err => {
      console.log('err', err)
    })
  }

  render() {
    return (
      <div>
        <p><button onClick={this.handleRequest}>点我发起跨域请求</button></p>
      </div>
    )
  }
}
